extends "../cTDW_1_1/cTDW_1_1.gd"
func _info():
	pass

func _connect():
	._connect()
var baseId = ""
func _extInit():
	._extInit()
	lv = 4
	attCoe.atk *=1.5
	attCoe.maxHp *= 1.7
	attCoe.def = 30 / 15.0 / 4.0
	attCoe.mgiDef = 30 / 16.6 / 4.0
	addCdSkill("jsys",10)
	addSkillTxt("一闪：冲向敌方生命比最高单位，对其造成300%物理伤害，若造成伤害后，敌方生命低于30%则直接斩杀[cd:10秒]")

func _castCdSkill(id):
	._castCdSkill(id)
	if id == "jsys":
		cst("一闪","000000",position)
		var chas = getAllChas(1)
		chas.sort_custom(self,"sort")
		jump(chas[0],self)
		aiCha = chas[0]
		hurtChara(chas[0],att.atk * 3,Chara.HurtType.PHY,Chara.AtkType.SKILL)
		if chas[0]:
			if chas[0].att.hp / chas[0].att.maxHp < 0.3:
				cst("被斩杀","FF0000",chas[0].position)
				chas[0].plusHp(-chas[0].att.hp)
				hurtChara(chas[0],0)

func sort(a,b):
	return (a.att.hp / a.att.maxHp) > (b.att.hp / b.att.maxHp)	


